/**
 * <copyright>
 * Copyrigth 2007 Aurelien Moreau
 *
 * This file is part of ProcessShop.
 *
 * ProcessShop is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * ProcessShop is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with ProcessShop; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 * </copyright>
 *
 * $Id$
 */
package net.yienyien.process.bpd.impl;

import net.yienyien.process.bpd.*;
import net.yienyien.process.bpd.BPDComponent;
import net.yienyien.process.bpd.BPDModel;
import net.yienyien.process.bpd.BpdFactory;
import net.yienyien.process.bpd.BpdPackage;
import net.yienyien.process.bpd.ControlFlowRelation;
import net.yienyien.process.bpd.DataBasedXOR;
import net.yienyien.process.bpd.EndEvent;
import net.yienyien.process.bpd.EventBasedXOR;
import net.yienyien.process.bpd.IntermediateEvent;
import net.yienyien.process.bpd.ParallelFork;
import net.yienyien.process.bpd.ParallelJoin;
import net.yienyien.process.bpd.StartEvent;
import net.yienyien.process.bpd.Task;
import net.yienyien.process.bpd.XORMerge;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class BpdFactoryImpl extends EFactoryImpl implements BpdFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static BpdFactory init() {
		try {
			BpdFactory theBpdFactory = (BpdFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.yienyien.net/process/bpd"); 
			if (theBpdFactory != null) {
				return theBpdFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new BpdFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BpdFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case BpdPackage.TASK: return createTask();
			case BpdPackage.START_EVENT: return createStartEvent();
			case BpdPackage.INTERMEDIATE_EVENT: return createIntermediateEvent();
			case BpdPackage.END_EVENT: return createEndEvent();
			case BpdPackage.PARALLEL_FORK: return createParallelFork();
			case BpdPackage.PARALLEL_JOIN: return createParallelJoin();
			case BpdPackage.DATA_BASED_XOR: return createDataBasedXOR();
			case BpdPackage.EVENT_BASED_XOR: return createEventBasedXOR();
			case BpdPackage.XOR_MERGE: return createXORMerge();
			case BpdPackage.CONTROL_FLOW_RELATION: return createControlFlowRelation();
			case BpdPackage.BPD_MODEL: return createBPDModel();
			case BpdPackage.BPD_COMPONENT: return createBPDComponent();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Task createTask() {
		TaskImpl task = new TaskImpl();
		return task;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public StartEvent createStartEvent() {
		StartEventImpl startEvent = new StartEventImpl();
		return startEvent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IntermediateEvent createIntermediateEvent() {
		IntermediateEventImpl intermediateEvent = new IntermediateEventImpl();
		return intermediateEvent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EndEvent createEndEvent() {
		EndEventImpl endEvent = new EndEventImpl();
		return endEvent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ParallelFork createParallelFork() {
		ParallelForkImpl parallelFork = new ParallelForkImpl();
		return parallelFork;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ParallelJoin createParallelJoin() {
		ParallelJoinImpl parallelJoin = new ParallelJoinImpl();
		return parallelJoin;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataBasedXOR createDataBasedXOR() {
		DataBasedXORImpl dataBasedXOR = new DataBasedXORImpl();
		return dataBasedXOR;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EventBasedXOR createEventBasedXOR() {
		EventBasedXORImpl eventBasedXOR = new EventBasedXORImpl();
		return eventBasedXOR;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public XORMerge createXORMerge() {
		XORMergeImpl xorMerge = new XORMergeImpl();
		return xorMerge;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ControlFlowRelation createControlFlowRelation() {
		ControlFlowRelationImpl controlFlowRelation = new ControlFlowRelationImpl();
		return controlFlowRelation;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BPDModel createBPDModel() {
		BPDModelImpl bpdModel = new BPDModelImpl();
		return bpdModel;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BPDComponent createBPDComponent() {
		BPDComponentImpl bpdComponent = new BPDComponentImpl();
		return bpdComponent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BpdPackage getBpdPackage() {
		return (BpdPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static BpdPackage getPackage() {
		return BpdPackage.eINSTANCE;
	}

} //BpdFactoryImpl
